package com.woniu.product.client;

import com.woniu.product.client.param.AddCouponLogParram;
import com.woniu.product.client.param.ProvideCouponParam;
import com.woniu.product.client.param.ReceiveCouponParam;
import com.woniu.product.client.param.UpdateCouponLogParam;
import com.woniu.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(contextId = "couponManageClient", name = "product")
public interface CouponManageClient {

    /**
     * 发放优惠券
     */
    @PostMapping("provideCoupon")
    public Result provideCoupon(@RequestBody ProvideCouponParam provideCouponParam);


    /**
     * 领取优惠券
     * @param receiveCouponParam
     * @return
     */
    @PostMapping("receiveCoupon")
    public Result receiveCoupon(@RequestBody ReceiveCouponParam receiveCouponParam);


    /**
     * 新增优惠券记录
     *
     * @param addCouponLogParram
     * @return
     */
    @PostMapping("addCouponLog")
    public Result addCouponLog(@RequestBody AddCouponLogParram addCouponLogParram);

    /**
     * 修改优惠券记录
     *
     * @param updateCouponLogParam
     * @return
     */
    @PutMapping("updateCouponLog")
    public Result updateCouponLog(@RequestBody UpdateCouponLogParam updateCouponLogParam);

    /**
     * 修改领取的优惠券使用状态
     * @param couponReceiveId
     * @return
     */
    @PutMapping("updateCouponReceive")
    public Result updateCouponReceive(@RequestParam("couponReceiveId") Integer couponReceiveId);
}
